﻿@model IEnumerable<DaBF.Models.Category>

@{
    ViewData["Title"] = "CategoryList";
}

<h1>CategoryList</h1>

<p>
    <a asp-action="CategoryAdd">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.id)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CategoryName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ParentCategoryId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DeleteFlag)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateTime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CategoryName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ParentCategoryId)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DeleteFlag)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateTime)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.id">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.id">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.id">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
